<template>
  <div>
    <div class="column">
      <div class="column_card">
        <img src="@/assets/imgs/huiyuanka.png">
      </div>
      <div class="column_card_logo">
        <img :src="userinfo.AVATAR">
      </div>
      <div class="column_card_name">
        <span>{{userinfo.USERNAME}}</span>
      </div>
      <div class="column_card_img" @click="showCode(showQRcode)">
        <img src="@/assets/imgs/erweima.png">
      </div>
      <div class="column_card_text">
        <span>ID：{{userinfo.CARD_ID}}</span>
      </div>
      <div class="column_card_tabs">
        <div class="column_card_tabs_content" v-jl-link="'StoredValuePage'">
          <span class="column_card_tabs_content_text w12">储值</span>
          <span class="column_card_tabs_content_text">{{userinfo.HYCZ || 0}}</span>
        </div>
        <div class="column_card_tabs_content" v-jl-link="'IntegralPage'">
          <span class="column_card_tabs_content_text w12">积分</span>
          <span class="column_card_tabs_content_text">{{userinfo.HYJF || 0}}</span>
        </div>
        <div class="column_card_tabs_content" v-jl-link="'CouponsPage'">
          <span class="column_card_tabs_content_text w12">优惠券</span>
          <span class="column_card_tabs_content_text">{{userinfo.coupon || 0}}</span>
        </div>
      </div>
    </div>
    <div class="content">
      <div>
        <img class="fl ml15 mt15" src="@/assets/imgs/fapiao.png">
        <img class="fr mr15 mt15" src="@/assets/imgs/xiala.png">
        <span class="content_text">查询电子发票</span>
      </div>
      <hr class="line">
      <div class="content_search">
        <form class="content_search_text">
          <input type="text" v-model="phoneNumber" placeholder="输入手机号"/>
        </form>
      </div>
      <div class="content_search">
        <form class="content_search_text">
          <input type="text" v-model="orderId" placeholder="输入单号"/>
        </form>
      </div>
      <button class="content_button" v-jl-link="'ReceiptPage'">
        <span class="content_button_text">查询</span>
      </button>
    </div>
    <div class="content mt15 pb10">
      <div class="w12" v-jl-link="'MaintenanceDeclarationPage'">
        <img class="fl ml15 mt15" src="@/assets/imgs/weixiu.png">
        <img class="fr mr15 mt15" src="@/assets/imgs/gengduo.png">
        <span class="content_text">维修申报</span>
      </div>
      <hr class="line">
      <div class="w12" v-jl-link="'SettingPage'">
        <img class="fl ml15 mt10" src="@/assets/imgs/shezhi.png">
        <img class="fr mr15 mt10" src="@/assets/imgs/gengduo.png">
        <span class="content_text mt10">设置</span>
      </div>
    </div>

    <JL-QRcodejs2 :qrcode="'{{userinfo.CARD_ID}}'" v-if="showQRcode"/>
  </div>

</template>

<script>
  export default {
    name: 'MainPage',
    data () {
      return {
        phoneNumber: '',
        orderId: '',
        userinfo:[],
        showQRcode:false,
      }
    },
    mounted() {
      this.$inbound.invoke({
        interfaceId:'app.member.queryHomeDate',
        data:{user_id:localStorage.getItem('userId')}})
        .then(msg =>{
          this.userinfo = msg['data'];
        })
    },
    methods: {
      showCode(item){
        this.showQRcode = !item;
      }
    }
  }
</script>

<style scoped>

  .column {
    float: left;
    width: calc(100% - 30px);
    border-radius: 5px
  }

  .column_card {
    float: left;
    margin: 20px 15px 15px 15px;
    position: absolute;
    z-index: -100;
  }

  .column_card_logo {
    float: left;
    position: relative;
    z-index: -99;
    width: 50px;
    height: 50px;
    left: 30px;
    top: 30px;
  }

  .column_card_name {
    float: left;
    position: relative;
    z-index: -99;
    left: 40px;
    top: 35px;
    font-family: 'pingfang medium';
    font-size: 13px;
    color: #fff;
  }

  .column_card_img {
    float: right;
    position: relative;
    /*z-index: -99;*/
    right: 5px;
    top: 35px;
  }

  .column_card_text {
    float: left;
    position: relative;
    z-index: -99;
    left: -10px;
    top: 55px;
    font-family: 'pingfang medium';
    font-size: 13px;
    color: #fff;
  }

  .column_card_tabs {
    float: left;
    width: 100%;
    text-align: center;
    bottom: 0;
    left: 0;
    position: relative;
    margin-left: 15px;
    top: 48px;
  }

  .column_card_tabs_content {
    float: left;
    width: 33.333333%;
  }

  .column_card_tabs_content_text {
    font-family: 'pingfang bold';
    font-size: 18px;
    color: #fff;
  }

  .content {
    float: left;
    width: calc(100% - 30px);
    box-shadow: 0px 0px 6px #ccc;
    margin: 90px 0 0 15px;
    border-radius: 5px
  }

  .content_text {
    float: left;
    font-family: 'pingfang medium';
    font-size: 13px;
    color: #333;
    margin: 15px 0 0 5px;
  }

  .line {
    float: left;
    width: 100%;
    border: 1px solid #f5f5f5;
    margin-top: 10px;
  }

  .content_search {
    float: left;
    width: calc(100% - 30px);
    height: 34px;
    border-radius: 5px;
    box-shadow: 0px 0px 3px #ccc inset;
    line-height: 30px;
    margin-left: 15px;
    margin-top: 10px;
  }

  .content_search_text {
    float: left;
    font-family: 'pingfang regular';
    font-size: 12px;
    color: #999;
    margin-left: 10px;
  }

  .content_button {
    float: left;
    width: 150px;
    height: 34px;
    border-radius: 5px;
    background-color: #6996FF;
    box-shadow: 0px 0px 3px #5387FF;
    margin-left: calc((100% - 150px) / 2);
    margin-top: 25px;
    margin-bottom: 15px;
  }

  .content_button_text {
    font-family: 'pingfang bold';
    font-size: 15px;
    color: #fff;
  }


</style>
